package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbTypeTemplateMapper;
import com.dongdongshop.pojo.TbTypeTemplate;
import com.dongdongshop.service.TempLateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @Description
 * @ClassName TempLateServiceImpl
 * @Author RC
 * @date 2020.12.10 21:49
 */
@Component
@Service
public class TempLateServiceImpl implements TempLateService {
    @Autowired
    private TbTypeTemplateMapper tbTypeTemplateMapper;
    @Override
    public List<TbTypeTemplate> getTempLateList() {
        return tbTypeTemplateMapper.selectByExample(null);
    }

    @Override
    public void saveTemplate(TbTypeTemplate tbTypeTemplate) {
        int i = tbTypeTemplateMapper.insertSelective(tbTypeTemplate);
    }

    @Override
    public TbTypeTemplate getBrandById(Long id) {
        return tbTypeTemplateMapper.selectByPrimaryKey(id);
    }

    @Override
    public void deleteBatchTemplate(Integer[] ids) {
        tbTypeTemplateMapper.deleteBatchTemplate(ids);
    }

    @Override
    public void updateTemplate(TbTypeTemplate tbTypeTemplate) {
        tbTypeTemplateMapper.updateByPrimaryKeySelective(tbTypeTemplate);
    }
    //根据分类表typeId查询模板表信息 回显
    @Override
    public TbTypeTemplate getTempLateByTypeId(Long typeId) {

        return tbTypeTemplateMapper.getTempLateByTypeId(typeId);
    }

    @Override
    public TbTypeTemplate getBrandByItemId(Long id) {
        return tbTypeTemplateMapper.selectByPrimaryKey(id);

    }
}
